package com.hnhs.mapper;

import com.hnhs.model.CateproInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CateProScreenDao {

    @Select("select c.name as category_name ,COUNT(p.id) as product_count   " +
            "FROM 202_category c LEFT JOIN 202_product p " +
            "on c.id=p.categoryId where c.status= 1 GROUP BY c.id,c.name")
    public List<CateproInfo> selectcatepro();

    @Select("select c.name,COUNT(p.id) as ptotal FROM 202_category c JOIN 202_product p on " +
            "c.id=p.categoryId where c.status = 1 GROUP BY c.name")
    List<Map> selectBar();

}
